package ooday04;
/*主人*/
public class Master {
    /*维护性不好、复用性不好
    void feed(Dog dog){
        dog.eat();
    }
    void feed(Fish fish){
        fish.eat();
    }
    void feed(Chick chick){
        chick.eat();
    }
     */
    /*用造型写*/
    void feed(Animal animal){
        animal.eat();
        animal.drink();
    }
}
